<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<html>
<head>
<!-- 导入jquery核心类库 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<!-- 导入easyui类库 -->
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/ext/portal.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/css/default.css">	
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.portal.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.cookie.js"></script>
<script
	src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"
	type="text/javascript"></script>
	
<script type="text/javascript">
  function filter(q, row){  
     var opts = $(this).combobox('options');  
     return row[opts.textField].indexOf(q) >= 0;//这里改成>=即可在任意地方匹配  
 }
 
  function isSelected(id){
		var select = $('#'+id).combobox('panel').find('.combobox-item-selected') 
		if(select.length==0){
			$.messager.alert('消息','请在下拉框中选取项目！','info');
			$('#'+id).combobox('clear');
			return 1;
		}
  }
  
  function comboboxIsSelected(id){
		var select = $('#'+id).combobox('panel').find('.combobox-item-selected') 
		if(select.length==0){
			
			$('#'+id).combobox('clear');
			return false;
		}else{
			return true;
		}
}


$.ajaxSetup({
	 cache: false,
    contentType: "application/x-www-form-urlencoded;charset=utf-8",
    complete: function (XMLHttpRequest, textStatus) {
        var sessionstatus = XMLHttpRequest.getResponseHeader("sessionstatus");
        //通过XMLHttpRequest取得响应头，sessionstatus，
         if (sessionstatus == "timeout") {
            //如果超时就处理 ，指定要跳转的页面
           // window.parent.location.replace("${ctx}/login");
            $.messager.alert('消息','您登录后长时间未操作，安全起见请重新登录！ ','info',function () {location.reload();});
        }
        else if (sessionstatus == "meiquanxian") {
            //如果超时就处理 ，指定要跳转的页面
            // window.parent.location.replace("${ctx}/login");
             $.messager.alert('消息','您没有使用此功能的权限！','info');
         }
    }
});

var sessionstaff=<%=session.getAttribute("staff")%>;

$.fn.serializeObject = function()
{
	var o = {};
	var a = this.serializeArray();
	$.each(a, function() {
		if (o[this.name] !== undefined) {
			if (!o[this.name].push) {
				o[this.name] = [o[this.name]];
			}
			o[this.name].push(this.value || '');
		} else {
			o[this.name] = this.value || '';
		}
	});
	return o;
};

function log(info){
	console.log(info)
}
</script>
 
 


</html>